/* Copyright (C) 2010 by Pavel Savara
This file is part of jni4net library - bridge between Java and .NET
http://jni4net.sourceforge.net/

This content is released under the (http://opensource.org/licenses/MIT) MIT License, see license/jni4net-MIT.txt.
*/

package system;

import net.sf.jni4net.inj.IClrProxy;
import net.sf.jni4net.Bridge;

    @net.sf.jni4net.attributes.ClrType
public class Exception extends java.lang.RuntimeException implements IClrProxy, system.IObject {

	private long clrHandle;

	public long getClrHandle() {
		return clrHandle;
	}

	public void initProxy(long handle) {
		clrHandle = handle;
	}

	protected Exception(net.sf.jni4net.inj.INJEnv env, long handle) {
		clrHandle = handle;
	}

    @Override
    public java.lang.String toString() {
        return ToString();
    }

    @Override
    public boolean equals(java.lang.Object o){
        return o instanceof Exception && Equals(Bridge.cast(o, Object.class));
    }

    @Override
    public int hashCode(){
        return GetHashCode();
    }


	@Override
	protected void finalize() throws Throwable {
		try {
			if (clrHandle != 0) {
				net.sf.jni4net.Bridge.DisposeClrHandle(clrHandle);
				clrHandle = 0;
			}
		} finally {
			super.finalize();
		}
	}

	//<generated-proxy>
    private static system.Type staticType;
    
    @net.sf.jni4net.attributes.ClrConstructor("()V")
    public Exception() {
        system.Exception.__ctorException0(this);
    }
    
    @net.sf.jni4net.attributes.ClrConstructor("(LSystem/String;)V")
    public Exception(java.lang.String message) {
        system.Exception.__ctorException1(this, message);
    }
    
    @net.sf.jni4net.attributes.ClrConstructor("(LSystem/String;LSystem/Exception;)V")
    public Exception(java.lang.String message, system.Exception innerException) {
        system.Exception.__ctorException2(this, message, innerException);
    }
    
    @net.sf.jni4net.attributes.ClrMethod("()V")
    private native static void __ctorException0(net.sf.jni4net.inj.IClrProxy thiz);
    
    @net.sf.jni4net.attributes.ClrMethod("(Ljava/lang/String;)V")
    private native static void __ctorException1(net.sf.jni4net.inj.IClrProxy thiz, java.lang.String message);
    
    @net.sf.jni4net.attributes.ClrMethod("(Ljava/lang/String;Lsystem/Exception;)V")
    private native static void __ctorException2(net.sf.jni4net.inj.IClrProxy thiz, java.lang.String message, system.Exception innerException);
    
    @net.sf.jni4net.attributes.ClrMethod("()LSystem/String;")
    public native java.lang.String getMessage();
    
    @net.sf.jni4net.attributes.ClrMethod("()LSystem/Collections/IDictionary;")
    public native system.collections.IDictionary getData();
    
    @net.sf.jni4net.attributes.ClrMethod("()LSystem/Exception;")
    public native system.Exception GetBaseException();
    
    @net.sf.jni4net.attributes.ClrMethod("()LSystem/Exception;")
    public native system.Exception getInnerException();
    
    @net.sf.jni4net.attributes.ClrMethod("()LSystem/Reflection/MethodBase;")
    public native system.reflection.MethodBase getTargetSite();
    
    @net.sf.jni4net.attributes.ClrMethod("()LSystem/String;")
    public native java.lang.String getStackTraceNet();
    
    @net.sf.jni4net.attributes.ClrMethod("()LSystem/String;")
    public native java.lang.String getHelpLink();
    
    @net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)V")
    public native void setHelpLink(java.lang.String value);
    
    @net.sf.jni4net.attributes.ClrMethod("()LSystem/String;")
    public native java.lang.String getSource();
    
    @net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)V")
    public native void setSource(java.lang.String value);
    
    @net.sf.jni4net.attributes.ClrMethod("()LSystem/String;")
    public native java.lang.String ToString();
    
    @net.sf.jni4net.attributes.ClrMethod("(LSystem/Runtime/Serialization/SerializationInfo;LSystem/Runtime/Serialization/StreamingContext;)V")
    public native void GetObjectData(system.runtime.serialization.SerializationInfo info, system.runtime.serialization.StreamingContext context);
    
    @net.sf.jni4net.attributes.ClrMethod("()LSystem/Type;")
    public native system.Type GetType();
    
    @net.sf.jni4net.attributes.ClrMethod("(LSystem/Object;)Z")
    public native boolean Equals(system.Object obj);
    
    @net.sf.jni4net.attributes.ClrMethod("()I")
    public native int GetHashCode();
    
    public static system.Type typeof() {
        return system.Exception.staticType;
    }
    
    private static void InitJNI(net.sf.jni4net.inj.INJEnv env, system.Type staticType) {
        system.Exception.staticType = staticType;
    }
    //</generated-proxy>
}
